package com.guoxin.factory.absfactory.pizzastore.order;

import com.guoxin.factory.absfactory.pizzastore.pizza.BJCheesePizza;
import com.guoxin.factory.absfactory.pizzastore.pizza.BJPepperPizza;
import com.guoxin.factory.absfactory.pizzastore.pizza.Pizza;

/**
 * @author guoxin
 * @date 2019/8/15
 */
public class BJFactory implements AbsFactory {

    /**
     * 让工厂子类具体实现
     */
    @Override
    public Pizza createPizza(String type) {
        Pizza pizza;
        switch (type) {
            case "cheese":
                pizza = new BJCheesePizza("北京奶酪pizza");
                break;
            case "pepper":
                pizza = new BJPepperPizza("北京胡椒pizza");
                break;
            default:
                pizza = null;
                break;
        }
        return pizza;
    }


}
